import { post } from '../http'
import { cherryPick2Dict } from '@/utils/formatResponseData'

// 营收汇总 时间查询条件
export const revenueSummary = () =>
  post({
    url: '/revenueSummary/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        channelTypeEnums: 'channelTypeEnums',
        orderQueryTypeEnums: 'orderQueryTypeEnums',
        orderFeeQueryTypeEnums: 'orderFeeQueryTypeEnums',
        tenantCostConfigTypeEnums: 'tenantCostConfigTypeEnums',
        incomeItemEnums: 'incomeItemEnums',
      }),
  })

// 车辆状态
export const carStatusDict = () =>
  post({
    url: '/singleCarStatistics/getEnums',
    format: (res) =>
      cherryPick2Dict(res.result, {
        operateStatusEnums: 'operateStatusEnums',
        carSourceEnums: 'carSourceEnums',
        profitFlagEnums: 'profitFlagEnums',
        tenantCostConfigTypeEnums: 'tenantCostConfigTypeEnums',
        deductibleFeeNameEnums: 'deductibleFeeNameEnums',
        oilFeeNameEnums: 'oilFeeNameEnums',
        carDamageFeeNameEnums: 'carDamageFeeNameEnums',
        ifChangeEnums: 'ifChangeEnums',
      }),
  })
